package com.glsc.ngateway.common.base.domain.mysql.gateway.oaflow;

import com.glsc.ngateway.common.base.domain.mysql.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 衡泰xir指令同步记录表
 *
 * @author xuchang
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@Where(clause = "deleted = 0")
@SQLDelete(sql = "update t_oa_flow_authority set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@SQLDeleteAll(sql = "update t_oa_flow_authority set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@Table(name = "t_oa_flow_authority")
public class TOaFlowAuthority extends BaseEntity {

    private static final long serialVersionUID = -3264094474527903316L;

    @Column(name = "workflow_id", columnDefinition = "varchar(128) not null comment 'workflow id'")
    private String workflowId;

    @Column(name = "authType", columnDefinition = "varchar(128) not null comment '权限类别'")
    private String authType;

    @Column(name = "auth_value", columnDefinition = "varchar(128) not null comment '权限值'")
    private String authValue;

}
